<template>
	<view class="popup flex justify-center items-center" v-if="show">
		<view class="flex flex-col items-center">
			<view class="title">
				登录
			</view>
			<view class="content">
				您未登录，请先登录
			</view>
			<view class="phone">
				<button open-type="getPhoneNumber" @getphonenumber="bindPhone">
					<text class="a">点击授权</text>
				</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "loginModal",
		props: {
			show: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {

			};
		},
		methods: {
			async bindPhone(res) {
				// await getApp().login()
				await this.$request('/api/bindPhone', {
					code: res.detail.code
				}, 'get')
				this.$emit('close')
			},
		}
	}
</script>

<style scoped lang="less">
	.popup {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 99;
		width: 100vw;
		height: 100vh;
		background: rgba(0, 0, 0, 0.6);

		&>view {
			width: 70%;
			height: 30vh;
			background: #fff;
			border-radius: 10rpx;
		}

		.title {
			font-size: 38rpx;
			font-weight: bold;
			line-height: 150rpx;
			color: #00f;
		}

		.content {
			margin: 0rpx 0 100rpx;
		}
	}
</style>